<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddAvatarToUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->string('avatar')->default('')->after('uid')->comment('头像');
            $table->string('description')->default('')->after('avatar')->comment('简介');
            $table->string('nickname', 30)->default('')->after('name')->comment('昵称');
            $table->tinyInteger('gender')->unsigned()->default(3)->after('nickname')->comment('性别:1男2女3未设置');
            $table->tinyInteger('status')->unsigned()->default(1)->after('nickname')->comment('状态:1正常0冻结');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('avatar');
            $table->dropColumn('description');
            $table->dropColumn('nickname');
            $table->dropColumn('gender');
            $table->dropColumn('status');
        });
    }
}
